package com.moli.iov.down.command.design.strategy.commandreqdto.impl;

import com.moli.iov.down.enums.command.CommandEnum;
import com.moli.iov.down.enums.command.TerminalControlEnum;
import com.moli.iov.down.enums.command.extend.ExtendRestartEnum;
import com.moli.iov.down.model.dto.remoting.CommandDto;
import com.moli.iov.down.model.dto.remoting.CommandReqDto;
import com.moli.iov.down.command.design.strategy.commandreqdto.CommandReqDtoStrategy;

/**
 * <p>
 * 终端重启
 * </p>
 *
 * @author: zql
 * @Date: 2018/12/28 11:56
 */
public class RestartStrategy implements CommandReqDtoStrategy {

    @Override
    public CommandDto make(CommandReqDto commandReqDto) {
        CommandDto commandDto = new CommandDto();
        commandDto.setVin(commandReqDto.getVin());
        commandDto.setIsRetry(commandReqDto.getIsRetry());

        commandDto.setCommand(CommandEnum.TERMINAL_CONTROL.getFlag());
        commandDto.setControlCommand(TerminalControlEnum.RESTART.getFlag());
        commandDto.setControlContent(ExtendRestartEnum.ENABLE.getFlag());
        return commandDto;
    }
}
